package com.wyh.springbootrabbitmq.listener;

import com.wyh.springbootrabbitmq.constant.Constant;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkListener {

    @RabbitListener(queues = Constant.WORK_QUEUE)
    public void queueListener1(Message message){
        System.out.println("Listener1 [" +Constant.WORK_QUEUE + "]接收到信息：" + message);
    }

    @RabbitListener(queues = Constant.WORK_QUEUE)
    public void queueListener2(Message message){
        System.out.println("Listener2 [" +Constant.WORK_QUEUE + "]接收到信息：" + message);
    }
}
